package com.lims.landInfo.dao;

import org.springframework.stereotype.Repository;

import javacommon.base.*;

import cn.org.rapid_framework.page.*;

import com.lims.landInfo.model.*;
import com.lims.landInfo.vo.query.*;

/**
 * @author zzh
 * @version 1.0
 * @since 1.0
 */@Repository @SuppressWarnings("unchecked")
public class ProjectDao extends BaseHibernateDao<Project,java.lang.String>{
	
	public Class getEntityClass() {
		return Project.class;
	}
	
	public Page findPage(ProjectQuery query) {
        // [column]为字符串拼接, {column}为使用占位符. [column]为使用字符串拼接,如username='[username]',偷懒时可以使用字符串拼接 
        // [column] 为PageRequest的属性
		String sql = "select t from Project t where 1=1 "
			  	+ "/~ and t.sno = {sno} ~/"
			  	+ "/~ and t.landno = {landno} ~/"
			  	+ "/~ and t.position = {position} ~/"
			  	+ "/~ and t.projectType = {projectType} ~/"
			  	+ "/~ and t.finistArea = {finistArea} ~/"
			  	+ "/~ and t.annualArea = {annualArea} ~/"
			  	+ "/~ and t.finistNum = {finistNum} ~/"
			  	+ "/~ and t.buildingArea = {buildingArea} ~/"
			  	+ "/~ and t.totalNum = {totalNum} ~/"
			  	+ "/~ and t.newBuildArea = {newBuildArea} ~/"
			  	+ "/~ and t.newNum = {newNum} ~/"
			  	+ "/~ and t.planArea = {planArea} ~/"
			  	+ "/~ and t.planNum = {planNum} ~/"
			  	+ "/~ and t.rateProgress = {rateProgress} ~/"
			  	+ "/~ and t.describe = {describe} ~/"
				+ "/~ and t.landDate >= {landDateBegin} ~/"
				+ "/~ and t.landDate <= {landDateEnd} ~/"
				+ "/~ and t.createDate >= {createDateBegin} ~/"
				+ "/~ and t.createDate <= {createDateEnd} ~/"
				+ " order by t.sno asc ";

		return pageQuery(sql,query);
	}
	

}
